package com.fitso.model.bean;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;

import com.fitso.model.bean.measure.length.Length;
import com.fitso.model.bean.measure.mass.Mass;

/**
 * <p>
 * Represents the attributes and characteristics of a body: weight, height,
 * measurements, etc...
 * </p>
 * 
 * @author timothystorm
 */
public class Body extends ModelBean implements Serializable {
	// Only change on breaking changes, i.e., removing fields
	private static final long serialVersionUID = 1L;
	
	public enum ActivityLevel {
		EXTREME, LIGHT, MODERATE, SEDENTARY, VERY
	}

	public enum Sex {
		FEMALE, MALE
	};

	private ActivityLevel _activityLevel;

	private Integer _age;

	private Length _height, _neck, _bicep, _forearm, _chest, _waist, _hips, _thigh, _calf;

	private Sex _sex;

	private Mass _weight;

	public Body() {}

	public boolean equals(Object o) {
		if (o instanceof Body == false) {
			return false;
		}
		if (this == o) {
			return true;
		}

		Body other = (Body) o;
		return new EqualsBuilder().append(_age, other._age).append(_height, other._height).append(_neck, other._neck)
				.append(_bicep, other._bicep).append(_forearm, other._forearm).append(_chest, other._chest).append(
						_waist, other._waist).append(_hips, other._hips).append(_thigh, other._thigh).append(_calf,
						other._calf).append(_sex, other._sex).append(_weight, other._weight).append(_activityLevel,
						other._activityLevel).isEquals();
	}

	public ActivityLevel getActivityLevel() {
		return _activityLevel;
	}

	public Integer getAge() {
		return _age;
	}

	public Length getBicep() {
		return _bicep;
	}

	public Length getCalf() {
		return _calf;
	}

	public Length getChest() {
		return _chest;
	};

	public Length getForearm() {
		return _forearm;
	}

	public Length getHeight() {
		return _height;
	}

	public Length getHips() {
		return _hips;
	}

	public Length getNeck() {
		return _neck;
	}

	public Sex getSex() {
		return _sex;
	}

	public Length getThigh() {
		return _thigh;
	}

	public Length getWaist() {
		return _waist;
	}

	public Mass getWeight() {
		return _weight;
	}

	public int hashCode() {
		return new HashCodeBuilder().append(_age).append(_height).append(_neck).append(_bicep).append(_forearm).append(
				_chest).append(_waist).append(_hips).append(_thigh).append(_calf).append(_sex).append(_weight).append(
				_activityLevel).toHashCode();
	}

	public void setActivityLevel(ActivityLevel activityLevel) {
		_activityLevel = activityLevel;
	}

	public void setAge(Integer age) {
		_age = age;
	}

	public void setBicep(Length bicep) {
		_bicep = bicep;
	}

	public void setCalf(Length calf) {
		_calf = calf;
	}

	public void setChest(Length chest) {
		_chest = chest;
	}

	public void setForearm(Length forearm) {
		_forearm = forearm;
	}

	public void setHeight(Length height) {
		_height = height;
	}

	public void setHips(Length hips) {
		_hips = hips;
	}

	public void setNeck(Length neck) {
		_neck = neck;
	}

	public void setSex(Sex sex) {
		_sex = sex;
	}

	public void setThigh(Length thigh) {
		_thigh = thigh;
	}

	public void setWaist(Length waist) {
		_waist = waist;
	}

	public void setWeight(Mass weight) {
		_weight = weight;
	}

	public String toString() {
		return new ReflectionToStringBuilder(this).toString();
	}
}
